package com.fyzk.activity.lottery.zc_new;


import android.content.Intent;
import android.view.View;

import com.fyzk.activity.lottery.zc_new.adapter.ZCBQCAdapter_New;
import com.fyzk.activity.lottery.zc_new.adapter.ZCBaseAdapter;
import com.fyzk.activity.zhifu.zc.ZhiFu_BQC_Activity;
import com.fyzk.bean.ZCGameQueueItem;
import com.tyjc.lottery.R;
import com.fyzk.utils.HelpUrlConstants;
import com.fyzk.utils.LotteryIDUtils;

import java.util.List;

public class OldFootballBQCActivity_New extends ZCBaseActivity_New{
	
	private ZCBaseAdapter adapter;

	@Override
	protected String getTopTitle() {
		// TODO Auto-generated method stub
		return getString(R.string.zc_bqc);
	}

	@Override
	protected int getLotteryID() {
		// TODO Auto-generated method stub
		return LotteryIDUtils.ZCBQC_LOTTERY_ID_INT;
	}

	@Override
	protected boolean isHiddenListHead() {
		return true;
	}

	@Override
	protected void changeAdapter(List<ZCGameQueueItem> infors) {
		// TODO Auto-generated method stub
		adapter.setList(infors);
	}

	@Override
	protected ZCBaseAdapter getAdapter(List<ZCGameQueueItem> infors) {
		// TODO Auto-generated method stub
		adapter = new ZCBQCAdapter_New(this, infors);
		adapter.setOnZCTongJiListener(this);
		return adapter;
	}

	@Override
	protected int minChangCi() {
		// TODO Auto-generated method stub
		return 6;
	}
	
	@Override
	protected int getListTitleVis() {
		// TODO Auto-generated method stub
		return View.GONE;
	}

	@Override
	protected void jiSuanZhu(List<ZCGameQueueItem> infors) {
		// TODO Auto-generated method stub
		int zhu = 1;
		for (int i = 0; i < infors.size(); i++) {
			ZCGameQueueItem info = infors.get(i);
			
			if ((info.isBanSheng || info.isBanPing || info.isBanFu) && 
					(info.isQuanSheng || info.isQuanPing || info.isQuanFu)) {
				changCi++;
			}
			
			zhu *= info.ban_clickNum * info.quan_clickNum; 
		}
		zhuShu = zhu;
	}

	@Override
	protected void randomBallNum(List<ZCGameQueueItem> infors) {
		// TODO Auto-generated method stub
		for (int i = 0; i < infors.size(); i++) {
			ZCGameQueueItem info = infors.get(i);
			int ban = (int) (Math.random()*3);
			int quan = (int) (Math.random()*3);
			switch (ban) {
			case 0:
				info.isBanSheng = true;
				break;
			case 1:
				info.isBanPing = true;
				break;
			case 2:
				info.isBanFu = true;
				break;
			default:
				break;
			}
			
			switch (quan) {
			case 0:
				info.isQuanSheng = true;
				break;
			case 1:
				info.isQuanPing = true;
				break;
			case 2:
				info.isQuanFu = true;
				break;
			default:
				break;
			}
			info.ban_clickNum = 1;
			info.quan_clickNum = 1;
		}
	}
	
	@Override
	protected int getWcodeID(int zhuShu, boolean isDanTuo) {
		// TODO Auto-generated method stub
		if (zhuShu > 1) {
			return LotteryIDUtils.ZCBQC_LOTTERY_COMMON_FU_INT;
		}else{
			return LotteryIDUtils.ZCBQC_LOTTERY_COMMON_DAN_INT;
		}
	}

	@Override
	protected String getHelpUrl() {
		// TODO Auto-generated method stub
		return HelpUrlConstants.Help_ZCBQC;
	}

	@Override
	protected String getHelpTitle() {
		// TODO Auto-generated method stub
		return getString(R.string.help_zcbqc);
	}

	@Override
	protected Intent getZhiFuIntent() {
		return new Intent(getContext(), ZhiFu_BQC_Activity.class);
	}
}
